package com.ely.coupon.auth.controller;

import com.ely.coupon.auth.api.AuthApi;
import com.ely.coupon.auth.service.AuthService;
import com.ely.coupon.common.core.result.ResponseResult;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/auth")
public class AuthController implements AuthApi {
    @Resource
    private AuthService authService;

    @Override
    public ResponseResult<String> auth(@RequestParam String username, @RequestParam String password) {
        return ResponseResult.success(authService.auth(username, password));
    }
}
